import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { visitorApplyInviteVO, visitorApplyInviteForm, visitorApplyInviteQuery } from '@/api/access/visitor/visitor-apply-invite/types';

/**
 * 查询访客申请邀约列表
 * @param query
 * @returns {*}
 */

export const listvisitorApplyInvite = (query?: visitorApplyInviteQuery): AxiosPromise<visitorApplyInviteVO[]> => {
  return request({
    url: '/visitor/visitor-apply-invite/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询访客申请邀约详细
 * @param visitorApplyInviteId
 */
export const getvisitorApplyInvite = (visitorApplyInviteId: string | number): AxiosPromise<visitorApplyInviteVO> => {
  return request({
    url: '/visitor/visitor-apply-invite/' + visitorApplyInviteId,
    method: 'get'
  });
};

/**
 * 新增访客申请邀约
 * @param data
 */
export const addvisitorApplyInvite = (data: visitorApplyInviteForm) => {
  return request({
    url: '/visitor/visitor-apply-invite',
    method: 'post',
    data: data
  });
};

/**
 * 修改访客申请邀约
 * @param data
 */
export const updatevisitorApplyInvite = (data: visitorApplyInviteForm) => {
  return request({
    url: '/visitor/visitor-apply-invite',
    method: 'put',
    data: data
  });
};

/**
 * 删除访客申请邀约
 * @param visitorApplyInviteId
 */
export const delvisitorApplyInvite = (visitorApplyInviteId: string | number | Array<string | number>) => {
  return request({
    url: '/visitor/visitor-apply-invite/' + visitorApplyInviteId,
    method: 'delete'
  });
};
